<?php

namespace App\mdoels;

use App\models\forum\Partition;
use App\models\user\User;
use Illuminate\Database\Eloquent\Model;

/**
 * App\mdoels\PostScript
 *
 * @property int $id
 * @property int $pid
 * @property int $uid
 * @property string $content
 * @property \Carbon\Carbon $created_at
 * @property \Carbon\Carbon $updated_at
 * @property-read \App\models\user\User $user
 * @property-read \App\models\forum\Partition $plate
 * @method static \Illuminate\Database\Query\Builder|\App\mdoels\PostScript whereId($value)
 * @method static \Illuminate\Database\Query\Builder|\App\mdoels\PostScript wherePid($value)
 * @method static \Illuminate\Database\Query\Builder|\App\mdoels\PostScript whereUid($value)
 * @method static \Illuminate\Database\Query\Builder|\App\mdoels\PostScript whereContent($value)
 * @method static \Illuminate\Database\Query\Builder|\App\mdoels\PostScript whereCreatedAt($value)
 * @method static \Illuminate\Database\Query\Builder|\App\mdoels\PostScript whereUpdatedAt($value)
 * @mixin \Eloquent
 */
class PostScript extends Model
{
    public function user(){
        return $this->belongsTo(User::class, 'uid', 'id');
    }

    public function plate(){
        return $this->belongsTo(Partition::class, 'pid', 'uid');
    }
}
